package com.doria.consumer.controller;

import com.doria.consumer.pojo.dto.LoginDto;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.util.Date;

@RestController
@RequestMapping("/actuator")
public class ActuatorController {

    @GetMapping("/info")
    public String info(){
        return "status:normal,time: "+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())+","+System.getenv();
    }

    @PostMapping("login")
    public String login(@RequestBody @Valid LoginDto loginDto){
        System.out.println(loginDto);
        return "SUCCESS";
    }
}
